package com.yihaodian.common.util;

import java.io.IOException;

import org.apache.lucene.index.IndexWriter;
import org.apache.lucene.util.Version;

public class Lucene {

	public static Version VERSION = Version.LUCENE_35;

	/**
	 * Closes the index writer, returning <tt>false</tt> if it failed to close.
	 */
	public static boolean safeClose(IndexWriter writer) {
		if (writer == null) {
			return true;
		}
		try {
			writer.close();
			return true;
		} catch (IOException e) {
			return false;
		}
	}

}
